/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.admin.vo;

import cn.hutool.core.date.DateUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.modules.admin.entity.BuildingContractPlus;

import java.util.Date;
import java.util.List;

/**
 * 项目合同信息视图实体类
 *
 * @author ysq
 * @since 2022-03-01
 */
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "BuildingContractPlusVO对象", description = "项目合同信息")
public class BuildingContractPlusVO extends BuildingContractPlus {

	@ApiModelProperty("录入创建时间")
	private Date createBeginTime;

	@ApiModelProperty("录入介绍时间")
	private Date createEndTime;

	@ApiModelProperty("合同服务开始时间-用来查询服务开始时间的筛选")
	private Date conBeginTime;

	@ApiModelProperty("合同服务结束时间-用来查询服务开始时间的筛选")
	private Date conEndTime;


	@ApiModelProperty("合同服务开始时间-用来查询结束开始时间的筛选")
	private Date conBeginTime2;

	@ApiModelProperty("合同服务结束时间-用来查询服务结束时间的筛选")
	private Date conEndTime2;


	@ApiModelProperty("项目名称")
	private String buildingName;

	@ApiModelProperty("电梯数量")
	private Long elevatorId;

	@ApiModelProperty("当前页")
	private Integer current;

	@ApiModelProperty("每页的数量")
	private Integer size;

	@ApiModelProperty("项目id")
	private Long buildingId;

	/**
	 * 07.29.2023 迭代新增
	 * 用于判断是否有合同附件
	 * 0:无 1:有
	 */
	@ApiModelProperty("合同附件")
	private Integer hasExt;

	@ApiModelProperty("到期月份")
	private List<Integer> endTimes;

	@ApiModelProperty("脱保月份")
	private List<Integer> tuoTimes;

	@ApiModelProperty("2:在保1:脱保")
	private Integer maintainStatus;

	@ApiModelProperty("1:表示协议查询合同")
	private Integer isAgreeSearch;

	@ApiModelProperty("合同统计搜索的类型")
	private Integer searchType;

	private List<Long> contractIds;

	@ApiModelProperty(value = "客户单位id")
	private List<Long> customerUnitIds;

	@ApiModelProperty(value = "合同ids")
	private List<Long> ids;


	@ApiModelProperty("项目id")
	private List<Long> buildingIds;


	@ApiModelProperty("电梯数量")
	private List<Long> elevatorIds;

	@ApiModelProperty("是否质保合同0:否，1是,-1表示无状态")
	private List<Integer> isQuaGuarantees;


	@ApiModelProperty("合同类型")
	private List<Integer> contractTypes;


	@ApiModelProperty(value = "合同归属")
	private List<Integer> fromTypes;

	@ApiModelProperty("合同管理状态")
	private List<Integer> contractStatuss;


	@ApiModelProperty("合同管理状态")
	private List<Integer> contractExtStatuss;


	@ApiModelProperty("合同管理状态")
	private List<Integer> contractSources;

	@ApiModelProperty("对接商务用户id")
	private Long businessUserId;

	@ApiModelProperty("电梯品牌")
	private Long brandId;

	@ApiModelProperty("超时类型 1:刚到期,2:超出3天,3:超出7天,4:超时1个月,5:超2月以上")
	private Integer timeOutType;
	private Integer timeOutBeginDay;
	private Integer timeOutEndDay;

	@ApiModelProperty("即将超时类型 1:不足7天,2:不足30天,3:不足60天,4:不足90天")
	private Integer aboutEndType;
	private Integer aboutEndBeginDay;
	private Integer aboutEndEndDay;

	public void setAboutEndType(Integer aboutEndType) {
		this.aboutEndType = aboutEndType;
		if (aboutEndType == 1) {
			this.aboutEndBeginDay = 0;
			this.aboutEndEndDay = 7;
		}
		if (aboutEndType == 2) {
			this.aboutEndBeginDay = 8;
			this.aboutEndEndDay = 30;
		}
		if (aboutEndType == 3) {
			this.aboutEndBeginDay = 31;
			this.aboutEndEndDay = 60;
		}
		if (aboutEndType == 4) {
			this.aboutEndBeginDay = 61;
			this.aboutEndEndDay = 90;
		}
	}


	public void setTimeOutType(Integer timeOutType) {
		this.timeOutType = timeOutType;
		if (timeOutType == 1) {
			this.timeOutBeginDay = 0;
			this.timeOutEndDay = 3;
		}
		if (timeOutType == 2) {
			this.timeOutBeginDay = 4;
			this.timeOutEndDay = 7;
		}

		if (timeOutType == 3) {
			this.timeOutBeginDay = 8;
			this.timeOutEndDay = 30;
		}
		if (timeOutType == 4) {
			this.timeOutBeginDay = 31;
			this.timeOutEndDay = 60;
		}

		if (timeOutType == 5) {
			this.timeOutBeginDay = 61;
			this.timeOutEndDay = 50000;
		}

	}


}
